package hub.cathome.service.impl;

import hub.cathome.entity.Like;
import hub.cathome.mapper.LikeMapper;
import hub.cathome.service.LikeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("likeService")
public class LikeServiceImpl implements LikeService {
    @Resource(name="likeMapper")
    private LikeMapper likeMapper;

    @Override
    public int insertLike(Like like) {
        return likeMapper.insertLike(like);
    }

    @Override
    public int deleteLike(Integer id) {
        return likeMapper.deleteLike(id);
    }

    @Override
    public Like getLikeById(Integer id) {
        return likeMapper.getLikeById(id);
    }

    @Override
    public List<Like> getLikeByShotBlogId(Integer shotBlogId) {
        return likeMapper.getLikeByShotBlogId(shotBlogId);
    }

    @Override
    public Like getLikeByShotBlogIdAndUserId(Integer shotBlogId, Integer userId) {
        return likeMapper.getLikeByShotBlogIdAndUserId(shotBlogId,userId);
    }
}
